package cn.tedu.fruitshop.pojo.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author www
 * @create 2022-11-30 18:09
 */
@Data
public class OrderAddCarDTO implements Serializable {

    /**
     * 用户id
     */
    @Range(min = 1L,message = "用户id非法")
    @NotNull(message = "用户id不能为空")
    private Integer userId;

    /**
     * 总价
     */
    @NotNull(message = "总价不能为空")
    @Range(min = 0,message = "总价非法")
    private Double totalPrice;

    /**
     * 商品总斤数
     */
    @NotNull(message = "总斤数不能为空")
    @Range(min = 0,message = "总斤数非法")
    private Double totalWeight;

    /**
     * 收货地址
     */
    @NotNull(message = "收货地址不能为空")
    private String deliveryAddress;
}
